package cn.net.isir.controller.application;

import cn.net.isir.common.ResultObject;
import cn.net.isir.entity.NotifyTask;
import cn.net.isir.service2.PrintTaskService;
import cn.net.isir.utils.StringUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author liuxubo
 * @filename PrintTaskManagerController.java
 * @package cn.net.isir.controller.application
 * @email lxb@isir.net.cn
 * @date 2018/12/27
 * @comment 打印任务管理(上菜管理)
 * @since 1.8
 */
@RestController
@RequestMapping("/app/printm")
public class PrintTaskManagerController {
    @Resource
    private PrintTaskService printTaskService;

    @RequestMapping(value = "/query/{shopId}", method = RequestMethod.GET)
    public ResultObject queryTask(@PathVariable String shopId) {
        if (StringUtils.isBlank(shopId)) {
            return new ResultObject(500, "店铺信息获取失败", null);
        }
        List<NotifyTask> notifyTaskList = printTaskService.queryTask(shopId);
        return new ResultObject(200, "success", notifyTaskList);
    }
}
